<?php $this -> load -> view('adminx/header'); ?>
<link href="/mex/admin/pages/css/profile.css" rel="stylesheet" type="text/css"/>
<!-- BEGIN CONTAINER -->
<div class="page-container">
	<!-- BEGIN SIDEBAR -->
	<?php $this -> load -> view('adminx/mune'); ?>
	<!-- END SIDEBAR -->
	<!-- BEGIN CONTENT -->
	<div class="page-content-wrapper">
		<div class="page-content">
			<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<!-- /.modal -->
			<h3 class="page-title"> <?php echo $title; ?> <small><?php echo $en; ?></small></h3>
			<div class="page-bar">
				<ul class="page-breadcrumb">
					<li>
						<i class="fa fa-home"></i>
						<a href="/adminx">首页</a>
						<i class="fa fa-angle-right"></i>
					</li>
					<li>
						<a href="#"><?php echo $title; ?></a>
					</li>
				</ul>
			</div>
			<!-- END PAGE HEADER-->
			<div class="row margin-top-20">
				<div class="col-md-12">
					<!-- BEGIN PROFILE SIDEBAR -->
					<div class="profile-sidebar">
						<!-- PORTLET MAIN -->
						<div class="portlet light profile-sidebar-portlet">
							<!-- SIDEBAR USERPIC -->
							<div class="profile-userpic">
								<img src="<?php echo ($m['headimgurl']?$m['headimgurl']:'/mex/lance/img/tx.jpg'); ?>" class="img-responsive" alt="">
							</div>
							<!-- END SIDEBAR USERPIC -->
							<!-- SIDEBAR USER TITLE -->
							<div class="profile-usertitle">
								<div class="profile-usertitle-name">
									<?php echo $m['name']; ?>
								</div>
								<div class="profile-usertitle-job">
									<?php echo $m['nickname']; ?>
								</div>
							</div>
							<!-- END SIDEBAR USER TITLE -->
							<!-- SIDEBAR BUTTONS -->
							<div class="profile-userbuttons">
								<a href="/adminx/yl/?mid=<?php echo $m['mid']; ?>#/shop/bill" class="btn btn-circle green-haze btn-sm">模拟登录</a>
								<button onclick="show_wx_ks('<?php echo $m['openid']; ?>','<?php echo $m['nickname']; ?>')" type="button" class="btn btn-circle btn-danger btn-sm">快速回复</button>
							</div>
							<!-- END SIDEBAR BUTTONS -->
							<!-- SIDEBAR MENU -->
							<!-- END MENU -->
							<br /><br /><br />
						</div>
						<!-- END PORTLET MAIN -->
						<!-- PORTLET MAIN -->
						<div class="portlet light">
							<!-- STAT -->
							<div class="row list-separated profile-stat">
								<div class="col-md-4 col-sm-4 col-xs-6">
									<div class="uppercase profile-stat-title">
										 <?php echo $zj_tx?$zj_tx:'0'; ?>
									</div>
									<div class="uppercase profile-stat-text">
										 总提现
									</div>
								</div>
								<div class="col-md-4 col-sm-4 col-xs-6">
									<div class="uppercase profile-stat-title">
										 <?php echo $zj_zsy?$zj_zsy:'0'; ?>
									</div>
									<div class="uppercase profile-stat-text">
										 总收益
									</div>
								</div>
								<div class="col-md-4 col-sm-4 col-xs-6">
									<div class="uppercase profile-stat-title">
										 <?php echo $zj_sy?$zj_sy:'0'; ?>
									</div>
									<div class="uppercase profile-stat-text">
										 可提现
									</div>
								</div>
							</div>
							<!-- END STAT -->
							<div>
								<h4 class="profile-desc-title">关于</h4>
								<span class="profile-desc-text">  <?php echo $m['bz']?$m['bz']:'一切源于热爱！'; ?></span>
								<div class="margin-top-20 profile-desc-link">
									<i class="fa fa-globe"></i>
									<a href="#"><?php echo $m['country'],' ',$m['province'],' ',$m['city'],' ',$m['zz']; ?></a>
								</div>
								<div class="margin-top-20 profile-desc-link">
									<i class="fa  fa-wechat"></i>
									<a href="#"><?php echo $m['openid']; ?></a>
								</div>
								<div class="margin-top-20 profile-desc-link">
									<i class="fa  fa-phone"></i>
									<a href="#"><?php echo $m['phone']; ?></a>
								</div>
							</div>
						</div>
						<!-- END PORTLET MAIN -->
					</div>
					<!-- END BEGIN PROFILE SIDEBAR -->
					<!-- BEGIN PROFILE CONTENT -->
					<div class="profile-content">
						<div class="row">
							<div class="col-md-12">
								<div class="portlet light">
									<div class="portlet-title tabbable-line">
										<div class="caption caption-md">
											<i class="icon-globe theme-font hide"></i>
											<span class="caption-subject font-blue-madison bold uppercase">个人资料</span>
										</div>
										<ul class="nav nav-tabs">
											<li class="active">
												<a href="#tab_1_1" data-toggle="tab" aria-expanded="true">现金交易</a>
											</li>
											<li class="">
												<a href="#tab_1_2" data-toggle="tab" aria-expanded="false">粉丝</a>
											</li>
											<?php if($this->session->userdata('state')==1 or $this->session->userdata('state')==2){ ?>
											<li class="">
												<a href="#tab_1_3" data-toggle="tab" aria-expanded="false">聊天</a>
											</li>
											<?php } ?>
											<li class="">
												<a href="#tab_1_5" data-toggle="tab" aria-expanded="false">上家</a>
											</li>
											<?php if($m['mid']==$this->session->userdata('midx')){ ?>
											<li class="">
												<a href="#tab_1_4" data-toggle="tab" aria-expanded="false">密码设置</a>
											</li>
											<?php } ?>
										</ul>
									</div>
									<div class="portlet-body">
										<div class="tab-content">
											<!-- PERSONAL INFO TAB -->
											<div class="tab-pane active" id="tab_1_1">
												<div class="table-scrollable">
												<table class="table table-bordered table-hover">
					<thead>
						<tr>
							<th>#</th>
							<th>项目</th>
							<th>内容</th>
							<th>金额</th>
							<th>状态</th>
							<th>时间</th>
						</tr>
					</thead>
					<tbody>
						<?php
		$state[1] = '<span class="label label-sm label-success">正常</span>';
		$state[2] = '<span class="label label-sm label-info">待处理</span>';
		$state[-1] = '<span class="label label-sm label-danger">作废</span>';

		$type[-1] = '<span class="label label-sm label-success">提现</span>';
		$type[-2] = '<span class="label label-sm label-success">购物</span>';
		$type[-3] = '<span class="label label-sm label-success">活动</span>';
		$type[-4] = '<span class="label label-sm label-success">竞拍</span>';
		$type[0] = '<span class="label label-sm label-success">未定义</span>';
		$type[1] = '<span class="label label-sm label-danger">充值</span>';
		$type[2] = '<span class="label label-sm label-success">粉丝红包</span>';
		$type[3] = '<span class="label label-sm label-success">礼券</span>';
		$type[4] = '<span class="label label-sm label-info">销售收益</span>';
		$type[-5] = '<span class="label label-sm label-warning">红包</span>';
						 foreach($bill as $v){ ?>
						<tr>
							<td><?php echo $v['id']; ?></td>
							<td><?php echo $type[$v['type']]; ?></td>
							<td><?php echo $v['content']; ?></td>
							<td><?php echo $v['je']; ?></td>
							<td><?php echo $state[$v['state']]; ?></td>
							<td><?php echo date('Y-m-d H:i',$v['mktime']); ?></td>
						</tr>
						<?php } ?>
					</tbody>
				</table>
				</div>
											</div>
											<!-- END PERSONAL INFO TAB -->
											<!-- CHANGE AVATAR TAB -->
											<div class="tab-pane" id="tab_1_2">
												<div class="table-scrollable table-scrollable-borderless">
												<table class="table table-hover table-light">
					<thead>
						<tr>
							<th>粉丝头像</th>
							<th>粉丝昵称</th>
							<th>关注时间</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach($fs as $v){  ?>
						<tr>
							<td ><a href="/iadmin/member/info/<?php echo $v['mid']; ?>"><img width="50" src="<?php echo $v['headimgurl']?$v['headimgurl']:'/mex/lance/img/tx.jpg'; ?>" /></a></td>
							<td><?php echo $v['nickname']?$v['nickname']:'未关注用户'; ?></td>
							<td><?php echo $v['subscribe_time']?date('Y-m-d H:i',$v['subscribe_time']):'未关注'; ?></td>
						</tr>
						<?php } ?>
					</tbody>
				</table>
				</div>
											</div>
											<!-- END CHANGE AVATAR TAB -->
											<!-- CHANGE PASSWORD TAB -->
											<div class="tab-pane" id="tab_1_3">
												<form class="btn-toolbar" id="get_tbody" onkeydown="if(event.keyCode==13)return false;">
									             <input type="hidden" id="openid" name="openid" value="<?php echo $m['openid']; ?>" />
									<div class="input-group" style="max-width: 250px;margin-right: 10px;">
						                 <input type="text" class="form-control form_datetimex"  id="day1" name="day1" value="<?php echo date('Y-m-d',strtotime('-7day')); ?>">
                                          <span class="input-group-btn">
                                              <button class="btn btn-default" type="button">-</button>
                                           </span>
                                          <input type="text" class="form-control form_datetimex"  id="day2" name="day2" value="<?php echo date('Y-m-d'); ?>">
                                       </div>
									<div class="portlet-input input-inline">
										<select id="page" name="page" class="form-control input-circle" style="width: 100px;"><option selected="" value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option></select>
									</div>
									<div class="portlet-input input-inline">
										<select id="state" name="state" class="form-control input-circle" style="width: 100px;">
												<option value="1">未回复</option>
												<option value="2">已经回复</option>
												<option value="0">全部</option>
										</select>
									</div>
									<div class="portlet-input input-inline">
										<select id="MsgType" name="MsgType" class="form-control input-circle" style="width: 100px;">
												<option value="0">全部</option>
												<option value="text" selected="">文字</option>
												<option value="voice">语音</option>
												<option value="image">图片</option>
												<option value="location">位置</option>
												<option value="link">链接</option>
												<option value="event">事件</option>
										</select>
									</div>
								</form>
												<div class="table-scrollable table-scrollable-borderless">
												<table class="table table-hover table-light">
					   <thead>
						<tr>
							<th>头像</th>
							<th>昵称</th>
							<th>类型</th>
							<th>内容</th>
							<th>时间</th>
							<th>状态</th>
						</tr>
					</thead>
					<tbody id="tbody">
					</tbody>
				</table>
				</div>
											</div>
											
											
											<div class="tab-pane" id="tab_1_5">
												<div class="table-scrollable table-scrollable-borderless">
												<table class="table table-hover table-light">
					   <thead>
						<tr>
							<th>级别</th>
							<th>头像</th>
							<th>昵称</th>
							<th>手机</th>
						</tr>
					</thead>
						<tbody>
						<?php  foreach($ms as $k=>$v){?>
						<tr>
							<td><?php echo $k; ?></td>
							<td><a href="/iadmin/member/info/<?php echo $v['mid']; ?>" target="_blank"><img src="<?php echo $v['headimgurl']?$v['headimgurl']:'/mex/lance/img/tx.jpg'; ?>" width="80"></a></td>
							<td><?php echo $v['nickname']; ?></td>
							<td><?php echo $v['phone']; ?></td>
						</tr>
						<?php } ?>
					</tbody>
				</table>
				</div>
											</div>
											
											
											<!-- END CHANGE PASSWORD TAB -->
											<!-- PRIVACY SETTINGS TAB -->
											<div class="tab-pane" id="tab_1_4">
												<form action="#" id="up_password">
													<div class="form-group">
														<label class="control-label">原密码</label>
														<input type="password" class="form-control required" name="password">
													</div>
													<div class="form-group">
														<label class="control-label">新密码</label>
														<input type="password" class="form-control required" name="password1" id="register_password">
													</div>
													<div class="form-group">
														<label class="control-label">再次输入新密码</label>
														<input type="password" class="form-control required equalto" name="password2" equalto="#register_password">
													</div>
													<div class="margin-top-10">
														<button type="submit" class="btn green-haze">
														修改密码 </button>
														<button type="reset" class="btn default">
														重置 </button>
													</div>
												</form>
											</div>
											<!-- END PRIVACY SETTINGS TAB -->
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					<!-- END PROFILE CONTENT -->
				</div>
			</div>
		</div>
	</div>
	

	<!-- BEGIN QUICK SIDEBAR -->
	<?php $this -> load -> view('adminx/lt'); ?>
	<!-- END QUICK SIDEBAR -->
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<?php $this -> load -> view('adminx/footer'); ?>
<?php if($this->session->userdata('state')==1 or $this->session->userdata('state')==2){ ?>
<script>
    var _model='weixin';
</script>
<script src="/mex/lance/domodel.js"></script>
<?php } ?>
<script>
$(function(){
	up_form($("#up_password"), "/iadmin/member/up_password", "修改密码", function(msg) {
			if (msg.type == 1) {
				alert_ts('修改密码成功');
			} else {
				alert_ts('修改密码失败！');
			}
		});
});

</script>
